﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="purchaseChargeSeller.aspx.cs"
    Inherits="PeisongWeb.admin.purchaseChargeSeller" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>负责供应商</title>
    <!--#include file="style.inc"-->

    <script src="../app_common/scripts/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script type="text/javascript">


        function selectAll(obj) {
            if ($(obj).attr('checked')) {
                $(':checkbox', $('#tablerange')).attr('checked', true);
            } else {
                $(':checkbox', $('#tablerange')).attr('checked', null);
            }
        }
        function selectAllItems(obj) {
            if ($(obj).attr('checked')) {
                $(':checkbox', $('#tablepurchase')).attr('checked', true);
            } else {
                $(':checkbox', $('#tablepurchase')).attr('checked', null);
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="sm1" runat="server" />
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            负责供应商</h2>
        <p>
            &nbsp;</p>
        <asp:UpdatePanel runat="server" ID="UP1" UpdateMode="Always">
            <ContentTemplate>
                <ext:Panel ID="Panel1" runat="server" Title="供应商搜索" BodyStyle="padding:5px 5px 0"
                    Width="960" Frame="true" ButtonAlign="Center">
                    <Body>
                        <div id="admin_edit_content_search">
                            <ul>
                                <li style="width: 175px;">
                                    <label>
                                        大 类：</label>
                                    <asp:DropDownList runat="server" ID="ddl_adminRootCategory" DataTextField="parentname"
                                        DataValueField="parentcategoryId" AutoPostBack="True" OnSelectedIndexChanged="ddl_adminRootCategory_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </li>
                                <li style="width: 175px;">
                                    <label>
                                        小 类：</label>
                                    <asp:DropDownList runat="server" ID="ddl_adminSubCategory" DataTextField="name" DataValueField="categoryId"
                                        AutoPostBack="true" OnSelectedIndexChanged="ddl_adminSubCategory_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </li>
                                <li style="width: 195px;">
                                    <label style="width: 75px;">
                                        供应商编号:</label>
                                    <asp:TextBox ID="txt_sellerNo" runat="server" Width="70px"></asp:TextBox>
                                </li>
                                <li style="width: auto;">
                                    <asp:LinkButton ID="lbn_select" runat="server" Text="［搜索］" CausesValidation="false"
                                        OnClick="lbn_select_Click"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton2" runat="server" Text="[重置]" CausesValidation="false"></asp:LinkButton>
                                    <asp:LinkButton ID="lbn_addseller" runat="server" Text="[添加供应商]" CausesValidation="false"
                                        OnClick="lbn_addseller_Click"></asp:LinkButton>
                                </li>
                            </ul>
                        </div>
                    </Body>
                </ext:Panel>
                <p>
                    &nbsp;</p>
                <div id="admin_list_content" style="width: 960px;">
                    <table id="tablepurchase" cellpadding="0" cellspacing="0">
                        <tr class="header-row">
                            <th>
                                <input type="checkbox" id="chkall" onclick="selectAllItems(this);" />
                            </th>
                            <th>
                                序号
                            </th>
                            <th>
                                商品类别
                            </th>
                            <th>
                                供应商编号
                            </th>
                            <th>
                                供应商
                            </th>
                            <th>
                                供应商负责人
                            </th>
                            <th>
                                操作
                            </th>
                        </tr>
                        <asp:Repeater ID="rpt_pcslist" runat="server" OnItemCommand="rpt_pcslist_ItemCommand">
                            <ItemTemplate>
                                <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>' style="color: Black">
                                    <td>
                                        <asp:CheckBox runat="server" ID="chkChosed" />
                                        <asp:HiddenField ID="hidpcsid" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "pcsid")%>' />
                                    </td>
                                    <td>
                                        <%# Container.ItemIndex+1 %>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "name")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "companyNo")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "company")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "contact")%>
                                    </td>
                                    <td>
                                        <asp:LinkButton CommandName="Del" OnClientClick="return confirm('你确定要删除吗?');" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"pcsid") %>'
                                            runat="server" ID="lblDel">删除</asp:LinkButton>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                        <tr>
                            <td colspan="7">
                                <asp:Button runat="server" ID="btnDel" Text="批量删除" OnClick="btnDel_Click" />
                            </td>
                        </tr>
                    </table>
                    <div>
                        <webdiyer:AspNetPager ID="AspNetPager2" NumericButtonType="Text" MoreButtonType="Text"
                            OnPageChanged="AspNetPager2_PageChanged" runat="server" AlwaysShow="True" PageSize="20"
                            InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                            ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                            CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                            LastPageText="末页" PrevPageText="上一页">
                        </webdiyer:AspNetPager>
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
        <ext:Window ID="add_seller" runat="server" Title="添加供应商" Height="500px" Width="1000px"
            BodyStyle="padding: 6px; background-color: #fff;" AutoScroll="true" Modal="True"
            Resizable="false" ShowOnLoad="false" Draggable="false" Icon="ApplicationViewDetail">
            <Body>
                <asp:UpdatePanel runat="server" ID="UpdatePanel1">
                    <ContentTemplate>
                        <div class="details">
                            <table width="98%" border="0" cellpadding="4" cellspacing="1" style="text-align: left">
                                <tr>
                                    <td style="width: 18%">
                                        <label>
                                            大 类：</label>
                                        <asp:DropDownList runat="server" ID="ddl_CategoryRoot" DataTextField="name" DataValueField="categoryId"
                                            AutoPostBack="True" OnSelectedIndexChanged="ddl_CategoryRoot_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td style="width: 18%">
                                        <label>
                                            小 类：</label>
                                        <asp:DropDownList runat="server" ID="ddl_CategorySub" DataTextField="name" DataValueField="categoryId"
                                            AutoPostBack="true" OnSelectedIndexChanged="ddl_CategorySub_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td style="width: 18%">
                                        供应商编号:<asp:TextBox ID="txt_CompanyNo" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                    <td style="width: 16%">
                                        <asp:LinkButton ID="lbn_search" runat="server" Text="［搜索］" CausesValidation="false"
                                            OnClick="lbn_search_Click"></asp:LinkButton>
                                        <asp:LinkButton ID="lbn_reset" runat="server" Text="[重置]" CausesValidation="false"
                                            OnClick="lbn_reset_Click"></asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                            <table id="tablerange" width="98%" border="0" cellpadding="4" cellspacing="1" bgcolor="#99BBE8" style="text-align: left">
                                <tr align="center" style="height: 23px;">
                                    <th width="10%" bgcolor="#C0D5F0">
                                        <input type="checkbox" id="chkSelectedAll" onclick="selectAll(this);" />
                                    </th>
                                    <th width="10%" bgcolor="#C0D5F0">
                                        序号
                                    </th>
                                    <th width="12%" bgcolor="#C0D5F0">
                                        商品类别
                                    </th>
                                    <th width="15%" bgcolor="#C0D5F0">
                                        供应商编号
                                    </th>
                                    <th width="25%" bgcolor="#C0D5F0">
                                        供应商
                                    </th>
                                    <th width="16%" bgcolor="#C0D5F0">
                                        供应商负责人
                                    </th>
                                    <th width="12%" bgcolor="#C0D5F0">
                                        操作
                                    </th>
                                </tr>
                                <asp:Repeater ID="rpt_list" runat="server" OnItemCommand="rpt_list_ItemCommand">
                                    <ItemTemplate>
                                        <tr align="left" style="height: 20px;">
                                            <td bgcolor="#FFFFFF">
                                                <asp:CheckBox runat="server" ID="chkSelected" />
                                            </td>
                                            <td bgcolor="#FFFFFF">
                                                <%# Container.ItemIndex+1 %>
                                            </td>
                                            <td bgcolor="#FFFFFF">
                                                <%# DataBinder.Eval(Container.DataItem, "name")%>
                                                <asp:HiddenField ID="hidcid" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "categoryId")%>' />
                                            </td>
                                            <td bgcolor="#FFFFFF">
                                                <%# DataBinder.Eval(Container.DataItem, "companyNo")%>
                                                <asp:HiddenField ID="hidcompanyid" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "companyId")%>' />
                                            </td>
                                            <td bgcolor="#FFFFFF">
                                                <%# DataBinder.Eval(Container.DataItem, "company")%>
                                            </td>
                                            <td bgcolor="#FFFFFF">
                                                <%# DataBinder.Eval(Container.DataItem, "contact")%>
                                            </td>
                                            <td bgcolor="#FFFFFF">
                                                <asp:LinkButton CommandName="Add" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"categoryId")+","+DataBinder.Eval(Container.DataItem, "companyId") %>'
                                                    runat="server" ID="lblAdd">添加</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                                <tr>
                                    <td colspan="7">
                                        <asp:Button runat="server" ID="btnAddSelected" Text="添加选择项" OnClick="btnAddSelected_Click" />
                                    </td>
                                </tr>
                            </table>
                            <div id="page">
                                <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                                    OnPageChanged="AspNetPager1_PageChanged" runat="server" AlwaysShow="True" PageSize="20"
                                    InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                                    ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                                    CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                                    LastPageText="末页" PrevPageText="上一页">
                                </webdiyer:AspNetPager>
                            </div>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </Body>
        </ext:Window>
    </div>
    </form>

</body>
</html>
